﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Controls;

namespace Tworzenie_Grafiku
{
    class PolaKoszty
    {
        private TextBox lp;
        private TextBox opis;
        private TextBox ilosc;
        private TextBox cena;
        private TextBox vat;
        private TextBox wartcalk;

        public PolaKoszty() { }

        public PolaKoszty(TextBox lp, TextBox opis, TextBox ilosc, TextBox cena, TextBox vat, TextBox wartcalk)
        {
            this.lp = lp;
            this.opis = opis;
            this.ilosc = ilosc;
            this.cena = cena;
            this.vat = vat;
            this.wartcalk = wartcalk;
        }

        public TextBox getLp()
        {
            return this.lp;
        }

        public void setLp(TextBox lp)
        {
            this.lp = lp;
        }

        public TextBox getOpis()
        {
            return this.opis;
        }

        public void setOpis(TextBox opis)
        {
            this.opis = opis;
        }

        public TextBox getIlosc()
        {
            return this.ilosc;
        }

        public void setIlosc(TextBox ilosc)
        {
            this.ilosc = ilosc;
        }

        public TextBox getCena()
        {
            return this.cena;
        }

        public void setCena(TextBox cena)
        {
            this.cena = cena;
        }

        public TextBox getVat()
        {
            return this.vat;
        }

        public void setVat(TextBox vat)
        {
            this.vat = vat;
        }

        public TextBox getWartcalk()
        {
            return this.wartcalk;
        }

        public void setWartcalk(TextBox wartcalk)
        {
            this.wartcalk = wartcalk;
        }

        public void obliczWart()
        {
            if (ilosc.Text != "" && cena.Text != "" && vat.Text != "")
                wartcalk.Text = Convert.ToString(Convert.ToDouble(ilosc.Text) * (Convert.ToDouble(cena.Text) + Convert.ToDouble(cena.Text) * (Convert.ToDouble(vat.Text)*0.01)));
        }
    }
}
